package com.sinaapp.gavinzhang.GSpider.process;

/**
 * @author gavin
 * @version 1.0
 * @date 2016/9/10
 * @description 默认的处理过滤器
 */
public class DefaultHttpProcessorInterceptor implements HttpProcessorInterceptor {
    @Override
    public void preProcess(HttpProcessor httpProcessor) {
        httpProcessor.setHeader("Accept-Encoding", "gzip,identity,deflate,sdch");
        httpProcessor.setHeader("Accept-Language", "zh,zh-CN;q=0.8,en-US;q=0.6,en;q=0.4");
        httpProcessor.setHeader("Connection", "keep-alive");
        httpProcessor.setHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36");
    }

    @Override
    public void afterProcess(HttpProcessor httpProcessor) {
        //可以获取cookie
        //httpProcessor.getCookie();
    }
}
